
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta charset="utf-8"></meta>
      <meta name="viewport" content="width=device-width, initial-scale=1.0"></meta>
      <title>16.6.&nbsp;Monitoring - Chapter&nbsp;16.&nbsp;Operational</title>
      <link rel="stylesheet" type="text/css" href="../../docbook.css"></link>
      <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,400italic,600,300italic"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/codemirror.min.css"></link>
      <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/theme/neo.min.css"></link>
      <link rel="stylesheet" type="text/css" href="../../css/chunked-base.css"></link>
      <link rel="stylesheet" type="text/css" href="../../css/extra.css"></link><script src="//code.jquery.com/jquery-1.12.4.js" type="text/javascript"></script><script src="//cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js" type="text/javascript"></script><script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/codemirror.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/addon/runmode/runmode.min.js" type="text/javascript"></script><script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.11.0/mode/cypher/cypher.min.js" type="text/javascript"></script><script src="../../javascript/datatable.js" type="text/javascript"></script><script src="../../javascript/colorize.js" type="text/javascript"></script><script src="../../javascript/tabs-for-chunked.js" type="text/javascript"></script><script src="../../javascript/mp-nav.js" type="text/javascript"></script><script src="../../javascript/versionswitcher.js" type="text/javascript"></script><script src="../../javascript/version.js" type="text/javascript"></script><script src="//s3-eu-west-1.amazonaws.com/alpha.neohq.net/docs/new-manual/assets/search.js" type="text/javascript"></script><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></meta>
      <link rel="prev" href="../warmup/" title="16.5.&nbsp;Warmup"></link>
      <link rel="next" href="../../indexes/" title="Chapter&nbsp;17.&nbsp;Text and Lookup Indexes"></link>
      <link rel="shortcut icon" href="https://neo4j.com/wp-content/themes/neo4jweb/favicon.ico"></link><script>
        $(document).ready(function() {
          CodeMirror.colorize();
          tabTheSource($('body'));
          var $header = $('header').first();
          $header.prepend(
            $('<a href="" id="logo"><img src="https://neo4j.com/wp-content/themes/neo4jweb/assets/images/neo4j-logo-2015.png" alt="Neo4j Logo"></img></a>')
          );
          var $sidebar = $('<div id="sidebar-wrapper"></div>');
          $.get('toc.html', function (d){
            $(d).appendTo($sidebar);
            highlightToc();
            highlightLibraryHeader();
          });
          $sidebar.insertAfter($('header').first());
        });
        </script></head>
   <body>
      <header>
         <div class="searchbox">
            <form id="search-form" class="search" name="search-form" role="search"><input id="search-form-input" name="q" title="search" type="search" lang="en" placeholder="Search Neo4j docs..." aria-label="Search Neo4j documentation" max-length="128" required="required"></input><input id="search-form-button" type="submit" value="Search"></input></form>
         </div>
         <ul class="documentation-library">
            <li><a href="https://neo4j.com/docs/operations-manual/current">Operations Manual</a></li>
            <li><a href="https://neo4j.com/docs/developer-manual/current/">Developer Manual</a></li>
            <li><a href="https://neo4j.com/docs/ogm-manual/current/">OGM Manual</a></li>
            <li><a href="https://neo4j.com/docs/graph-algorithms/current/">Graph Algorithms</a></li>
            <li><a href="https://neo4j-contrib.github.io/neo4j-apoc-procedures/3.4/">APOC</a></li>
            <li><a href="https://neo4j.com/docs/java-reference/current/">Java Reference</a></li>
         </ul>
         <nav id="header-nav"><span class="nav-previous"><a accesskey="p" href="../warmup/"><span class="fa fa-long-arrow-left" aria-hidden="true"></span>Warmup</a></span><span class="nav-current">
               <p class="nav-title hidden">16.6.&nbsp;Monitoring</p></span><span class="nav-next"><a accesskey="n" href="../../indexes/">Text and Lookup Indexes<span class="fa fa-long-arrow-right" aria-hidden="true"></span></a></span></nav>
      </header>
      <div id="search-results" class="hidden"></div>
      <section class="section" id="monitoring">
         <div class="titlepage">
            <div>
               <div>
                  <h2 class="title" style="clear: both"><a class="anchor" href="#monitoring"></a>16.6.&nbsp;Monitoring
                  </h2>
               </div>
            </div>
         </div>
         <div class="informaltable">
            <div class="table" id="d0e19556">
               <table class="informaltable" border="1">
                  <colgroup>
                     <col class="col_1"></col>
                     <col class="col_2"></col>
                  </colgroup>
                  <tbody>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">apoc.monitor.ids</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>node and relationships-ids in total and in use</p>
                        </td>
                     </tr>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">apoc.monitor.kernel</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>store information such as kernel version, start time, read-only, database-name, store-log-version etc.</p>
                        </td>
                     </tr>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">apoc.monitor.store</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>store size information for the different types of stores</p>
                        </td>
                     </tr>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">apoc.monitor.tx</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>number of transactions total,opened,committed,concurrent,rolled-back,last-tx-id</p>
                        </td>
                     </tr>
                     <tr>
                        <td style="text-align: left; vertical-align: top; ">
                           <p><code class="literal">apoc.monitor.locks(minWaitTime long)</code></p>
                        </td>
                        <td style="text-align: left; vertical-align: top; ">
                           <p>db locking information such as avertedDeadLocks, lockCount, contendedLockCount and contendedLocks etc. (enterprise)</p>
                        </td>
                     </tr>
                  </tbody>
               </table>
            </div>
         </div>
         <section class="section" id="_uuid">
            <div class="titlepage">
               <div>
                  <div>
                     <h3 class="title"><a class="anchor" href="#_uuid"></a>16.6.1.&nbsp;UUID
                     </h3>
                  </div>
               </div>
            </div>
            <p>These procedures manage the UUID Handler Lifecycle.
               The UUID handler is a transaction event handler that automatically adds the UUID property to a provided label and for the
               provided property name.
               Please check the following documentation to an in-depth description.
            </p>
            <p>Enable <code class="literal">apoc.uuid.enabled=true</code> in <code class="literal">$NEO4J_HOME/config/neo4j.conf</code> first.
            </p>
            <div class="informaltable">
               <div class="table" id="d0e19614">
                  <table class="informaltable" border="1">
                     <colgroup>
                        <col class="col_1"></col>
                        <col class="col_2"></col>
                     </colgroup>
                     <tbody>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal"><span class="strong"><strong>procedure</strong></span></code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><span class="strong"><strong>description</strong></span></p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">CALL apoc.uuid.install(label, {addToExistingNodes: true/false, uuidProperty: 'uuid'}) yield label, installed, properties,
                                    batchComputationResult</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>it will add the uuid transaction handler
                                 for the provided <code class="literal">label</code> and <code class="literal">uuidProperty</code>, in case the UUID handler is already present it will be replaced by the new one
                              </p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">CALL apoc.uuid.remove(label) yield label, installed, properties</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>remove previously added uuid handler and returns uuid information. All the existing uuid properties are left as-is</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">CALL apoc.uuid.removeAll() yield label, installed, properties</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>removes all previously added uuid handlers and returns uuids information. All the existing uuid properties are left as-is</p>
                           </td>
                        </tr>
                        <tr>
                           <td style="text-align: left; vertical-align: top; ">
                              <p><code class="literal">CALL apoc.uuid.list() yield label, installed, properties</code></p>
                           </td>
                           <td style="text-align: left; vertical-align: top; ">
                              <p>provides a list of all the uuid handlers installed with the related configuration</p>
                           </td>
                        </tr>
                     </tbody>
                  </table>
               </div>
            </div>
            <section class="section" id="_config_4">
               <div class="titlepage">
                  <div>
                     <div>
                        <h4 class="title"><a class="anchor" href="#_config_4"></a>16.6.1.1.&nbsp;Config
                        </h4>
                     </div>
                  </div>
               </div>
               <div class="informaltable">
                  <div class="table" id="d0e19670">
                     <table class="informaltable" border="1">
                        <colgroup>
                           <col class="col_1"></col>
                           <col class="col_2"></col>
                           <col class="col_3"></col>
                        </colgroup>
                        <tbody>
                           <tr>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><span class="strong"><strong>config</strong></span></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><span class="strong"><strong>type</strong></span></p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p><span class="strong"><strong>description</strong></span></p>
                              </td>
                           </tr>
                           <tr>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>addToExistingNodes</p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>Boolean (default: true)</p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>when installed, for the label provided, adds the UUID to the nodes already existing in your graph</p>
                              </td>
                           </tr>
                           <tr>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>uuidProperty</p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>String (default: uuid)</p>
                              </td>
                              <td style="text-align: left; vertical-align: top; ">
                                 <p>the name of the UUID field</p>
                              </td>
                           </tr>
                        </tbody>
                     </table>
                  </div>
               </div>
            </section>
            <section class="section" id="_uuid_examples">
               <div class="titlepage">
                  <div>
                     <div>
                        <h4 class="title"><a class="anchor" href="#_uuid_examples"></a>16.6.1.2.&nbsp;UUID Examples
                        </h4>
                     </div>
                  </div>
               </div>
               <p>First create a Constraint for the Label and the Property, if you try to add a <code class="literal">uuid</code> an error occured.
               </p><pre class="programlisting highlight"><code data-lang="cypher">CREATE CONSTRAINT ON (person:Person) ASSERT person.uuid IS UNIQUE</code></pre><p>Add the <code class="literal">uuid</code>:
               </p><pre class="programlisting highlight"><code data-lang="cypher">CALL apoc.uuid.install('Person') YIELD label RETURN label</code></pre><p>The result is:</p><pre class="screen highlight"><code>+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| label    | installed | properties                                               | batchComputationResult                                                                                                                         |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "Person" | true      | {uuidProperty -&gt; "uuid", addToExistingNodes -&gt; true} | {wasTerminated -&gt; false, count -&gt; 10, batches -&gt; 1, successes -&gt; 1, failedOps -&gt; 0, timeTaken -&gt; 0, operationErrors -&gt; {}, failedBatches -&gt; 0} |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+</code></pre><p>The result is Node Person have 2 property:</p>
               <div class="informalfigure">
                  <div class="mediaobject"><img src="https://raw.githubusercontent.com/neo4j-contrib/neo4j-apoc-procedures/3.4/docs/images/apoc.uuid.result.png" width="800" alt="apoc.uuid.result"></img></div>
               </div>
               <p>Get all the uuid installed, call the procedure as:</p><pre class="programlisting highlight"><code data-lang="cypher">call apoc.uuid.list() yield label, installed return label, installed</code></pre><p>The result is:</p><pre class="screen highlight"><code>+---------------------------------------------------------------------------------+
| label    | installed | properties                                               |
+---------------------------------------------------------------------------------+
| "Person" | true      | {uuidProperty -&gt; "uuid", addToExistingNodes -&gt; true} |
+---------------------------------------------------------------------------------+</code></pre><p>Remove the uuid installed call the procedure as:</p><pre class="programlisting highlight"><code data-lang="cypher">call apoc.uuid.remove('Person') yield label return label</code></pre><p>The result is:</p><pre class="screen highlight"><code>+---------------------------------------------------------------------------------+
| label    | installed | properties                                               |
+---------------------------------------------------------------------------------+
| "Person" | false     | {uuidProperty -&gt; "uuid", addToExistingNodes -&gt; true} |
+---------------------------------------------------------------------------------+
1 row</code></pre><p>You can also remove all the uuid installed call the procedure as:</p><pre class="programlisting highlight"><code data-lang="cypher">call apoc.uuid.removeAll() yield label return label</code></pre><p>The result is:</p><pre class="screen highlight"><code>+---------------------------------------------------------------------------------+
| label    | installed | properties                                               |
+---------------------------------------------------------------------------------+
| "Person" | false     | {uuidProperty -&gt; "uuid", addToExistingNodes -&gt; true} |
+---------------------------------------------------------------------------------+</code></pre></section>
         </section>
      </section>
      <footer><script type="text/javascript">
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
          //Allow Linker
          ga('create', 'UA-1192232-34','auto', {'allowLinker': true});
          ga('send', 'pageview');
          // Load the plugin.
          ga('require', 'linker');
          // Define which domains to autoLink.
          ga('linker:autoLink', ['neo4j.org','neo4j.com','neotechnology.com','graphdatabases.com','graphconnect.com']);
        </script><script type="text/javascript">
          document.write(unescape("%3Cscript src='//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
        </script><script>Munchkin.init('773-GON-065');</script></footer>
   </body>
</html>